package com.brainardphotography.blog.web;

import com.brainardphotography.blog.dao.BlogEntryDAO;
import com.brainardphotography.blog.web.admin.Admin;
import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
import com.google.inject.Provides;
import com.google.sitebricks.SitebricksModule;
import com.googlecode.objectify.Objectify;
import com.googlecode.objectify.ObjectifyService;

public class BlogModule extends SitebricksModule {
	@Override
	protected void configureSitebricks() {
		scan(GuiceCreatorFactory.class.getPackage());
		scan(Admin.class.getPackage());
	}

//	@Provides
//	public UserService getUserService() {
//		return UserServiceFactory.getUserService();
//	}

	@Provides
	public DatastoreService getDataStoreService() {
		return DatastoreServiceFactory.getDatastoreService();
	}

	@Provides
	public Objectify getObjectifyService() {
		return ObjectifyService.begin();
	}

	@Provides
	public BlogEntryDAO getBlogEntryDAO() {
		//return new BlogEntryDAO(getObjectifyService());
		return new BlogEntryDAO();
	}
}
